package edu.tjut.tjutcommunity.service;

import com.baomidou.mybatisplus.extension.service.IService;
import edu.tjut.tjutcommunity.entity.PageResult;
import edu.tjut.tjutcommunity.entity.Post;
import edu.tjut.tjutcommunity.entity.User;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author yhh
 * @since 2022-04-16
 */
public interface PostService extends IService<Post> {
//    boolean addPost(Post post, User user, Integer ordinal) throws ClassNotFoundException, InvocationTargetException, PicNotFoundException, IllegalAccessException, NoSuchMethodException;
    Boolean addPost(Post post, User user);

    PageResult<Post> getPostByTimeAndPageSizeAndKey(String keyword, Integer pageSize, Date time, Integer type);
    PageResult<Post> getPostByPageAndKey(String keyword, Integer pageSize, Integer pageNo, Integer type);


    Boolean likeInc(Integer pid,User user);
    Boolean updateTime(Integer pid);
    Post getUidAndUsernameAndFloorsByPid(Integer pid);
    Boolean delPost(Integer pid, User user);
    Boolean floorsInc(Integer pid);

    PageResult<Post> getMyPost(Integer uid, Integer pageNo,String keyword);

    Post getPostById(String pid);

    List<Post> getPostByIds(Set<Integer> pids);

    List<Post> getRecPost(String inRecDate);

    PageResult<Post> getRecommendPost(User user, Integer derive,Integer pageNo,Integer size);


    boolean isMyPost(Integer pid, User user);

    List<Integer> getMyPosts(Integer uid);
}
